//
//  SeeBigImageViewController.m
//  ClassManager
//
//  Created by ihope99 on 2017/8/14.
//  Copyright © 2017年 GZX. All rights reserved.
//

#import "SeeBigImageViewController.h"
#import "ShowBigImageView.h"

@interface SeeBigImageViewController (){
    NSMutableArray *mArray;
}

@end

@implementation SeeBigImageViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    mArray = [NSMutableArray array];
    [mArray addObject:@"http://file.feiniaolive.com/c39e44998634f7068eaa62fe51edb684?imageView2/1/w/800/h/800/format/png/interlace/1/q/75|imageslim"];
    [mArray addObject:@"http://file.feiniaolive.com/c39e44998634f7068eaa62fe51edb684?imageView2/1/w/800/h/800/format/png/interlace/1/q/75|imageslim"];
    [mArray addObject:@"http://file.feiniaolive.com/c39e44998634f7068eaa62fe51edb684?imageView2/1/w/800/h/800/format/png/interlace/1/q/75|imageslim"];
    for (NSInteger i = 0; i <mArray.count ; i ++ ) {
        UIImageView *mKeyImageView =[[UIImageView alloc]initWithFrame:CGRectMake(100, 100 + 100*i, 100,100)];
        [mKeyImageView sd_setImageWithURL:[NSURL URLWithString:mArray[i]] placeholderImage:nil];
        mKeyImageView.tag = 100 + i;
        mKeyImageView.userInteractionEnabled = YES;
        mKeyImageView.backgroundColor = [UIColor redColor];
        [self.view addSubview:mKeyImageView];
        
        UITapGestureRecognizer *mTpa = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(keyTouch:)];
        [mKeyImageView addGestureRecognizer:mTpa];
    }
    
    
}
-(void)keyTouch:(UITapGestureRecognizer *)mtap{
    UIView *mView = mtap.view;
    NSInteger index = mtap.view.tag - 100;

    [[ShowBigImageView Share]showWithArray:mArray WithIndex:index WithClickView:mView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
